<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="__PUBLIC__/echarts/echarts.min.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="__PUBLIC__/font-awesome/css/font-awesome.min.css" media="all">
    <link rel="stylesheet" href="__CSS__/admin.css"  media="all">
</head>

<body>
<div class="layui-fluid main">
    <fieldset class="layui-elem-field site-demo-button" style="margin-top: 30px;border:0">
        <div class="layui-form-item" style="float: left;">
            <form class="layui-form serch" action="" method="">
                <div class="layui-form-item" style="float: left;">
                    <div class="layui-input-inline">
                        <input type="text" name="tripname" lay-verify="title" value="{if isset($wherelist['tripname'])}{$wherelist['tripname']}{/if}" autocomplete="off" placeholder="请输入定制名称" class="layui-input layui-btn-sm">
                    </div>
                    <button class="layui-btn layui-btn-danger layui-btn-sm" lay-submit="" lay-filter="serch">搜索</button>
                    <a href="{:url('admin/quicktrip/tripmake')}" class="layui-btn layui-btn-sm "target="_blank">
                        快速定制
                    </a>

                </div>
            </form>

        </div>
    </fieldset>
    <table class="layui-table" lay-even="" lay-skin="line">
        <colgroup>
            <col width="50">
            <col width="400">
            <col width="70">
            <col width="70">
            <col width="100">
            <col width="100">
            <col width="90">
            <col width="90">
            <col width="150">
            <col width="200">
        </colgroup>
        <thead>

        <tr>
            <th>ID</th>
            <th>定制名称</th>
            <th>天数</th>
            <th>人数</th>
            <th style="text-align:center">城市<br>（数量）</th>
            <th>定制师</th>
            <!--<th>定制状态</th>-->
            <!--<th>订单状态</th>-->
            <th>创建时间</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="trip" id="vo"}
        <tr>
            <td style="height:50px;">{$vo.id}</td>
            <td><strong>{$vo.name}</strong></td>
            <td>{$vo.days}</td>
            <td>{$vo.people}</td>
            <td style="text-align:center">{$vo.citys}</td>
            <td>{$vo.admin}</td>
            <!--<td>-->
                <!--&lt;!&ndash;定制完成状态&ndash;&gt;-->
                <!--{if $vo.admin_confirm<1}-->
                <!--<span class="layui-btn layui-btn-xs layui-btn-primary" style="color:#FFB800;border-style:none;background: none;">未完成</span>-->
                <!--{else}-->
                <!--<span class="layui-btn layui-btn-xs layui-btn-primary" style="color:#5FB878;border-style:none;background: none;">完成</span>-->
                <!--{/if}-->
            <!--</td>-->
            <!--<td>-->
                <!--&lt;!&ndash;支付状态&ndash;&gt;-->
                <!--{if $vo.isConfirm==1}-->
                <!--{if $vo.isPaid==1}-->
                <!--<span class="layui-btn layui-btn-xs layui-btn-primary" style="color:#5FB878;border-style:none;background: none;">已支付</span>-->
                <!--{else}-->
                <!--<span class="layui-btn layui-btn-xs layui-btn-primary" style="color:#FF5722;border-radius:12px;">待支付</span>-->
                <!--{/if}-->
                <!--{else}-->
                <!--<span class="layui-btn layui-btn-xs layui-btn-primary" style="color:#FFB800;border-style:none;background: none;">待确认</span>-->
                <!--{/if}-->
            <!--</td>-->
            <td>{$vo.create_time|date='Y-m-d H:i',###}</td>
            <td class="operation-menu">
                <a href="{:url('admin/quicktrip/tripmake',['id'=>$vo.id])}" class="layui-btn layui-btn-xs" target="_blank"  style="margin-right: 0;font-size:12px;">进入定制</a>
                <!--<a class="layui-btn layui-btn-xs layui-btn-danger delete"  codeid="{$vo.id}" style="margin-right: 0;font-size:12px;">删除</a>-->
                <a class="layui-btn layui-btn-xs" target="_blank" href="{:url('admin/trip/partnerpreview',['id'=>$vo.id])}"   style="margin-right: 0;font-size:12px;">预览</a>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div style="padding:0 20px;">{$trip->render()}</div>


    <script src="__PUBLIC__/layui/layui.js"></script>
    <script src="__PUBLIC__/jquery/jquery.min.js"></script>

    <script type="text/javascript">

        $('.delete').click(function(){
            var id = $(this).attr('codeid');
            layer.confirm('确定要删除?', function(index) {
                $.ajax({
                    url:"{:url('admin/quicktrip/deltrip')}",
                    data:{id:id},
                    success:function(res) {
                        layer.msg(res.msg);
                        if(res.code == 1) {
                            setTimeout(function(){
                                location.reload();
                            },1500)
                        }
                    }
                })
            })
        });

        layui.use(['layer','form'], function(){
            var layer = layui.layer;
            var form = layui.form;
            $('.a_menu').click(function(){
                var url = $(this).attr('href');
                var a = 0;
                $.ajax({
                    url:url
                    ,async:false
                    ,success:function(res){
                        if(res.code == 0) {
                            layer.msg(res.msg);
                            a = 1;
                        }
                    }
                })
                if(a === 0) {
                    layer.open({
                        type:2,
                        content:url,
                        area: ['700px', '600px'],
                        end:function(){
                            location.reload();
                        }
                    });
                }
                return false;
            })

            $('.preview').click(function(){
                var url = $(this).attr('href');
                layer.open({
                    type:2,
                    content:url,
                    area: ['550px', '400px']
                });
                return false;
            })
        });
    </script>

</div>
</body>
</html>
